package com.zp.mvppractice.io;


import com.zp.mvppractice.BuildConfig;
import com.zp.mvppractice.beans.Bill;
import com.zp.mvppractice.beans.Customer;
import com.zp.mvppractice.beans.Employee;
import com.zp.mvppractice.beans.MsgList;
import com.zp.mvppractice.beans.Product;
import com.zp.mvppractice.beans.ResponseBean;
import com.zp.mvppractice.beans.User;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * Created by izp on 2017/4/14.
 */

public interface Apis {

    interface PaymentButler {
        String baseUrl = BuildConfig.IS_DEBUG?"http://testapi.huikuanguanjia.com":"http://api.huikuanguanjia.com";
        @FormUrlEncoded
        @POST("reg")
        Observable<ResponseBean<List<User>>> register(@FieldMap Map<String, String> params);

        @FormUrlEncoded
        @POST("resetpass")
        Observable<ResponseBean<List<User>>> resetPass(@FieldMap Map<String, String> params);

        @FormUrlEncoded
        @POST("login")
        Observable<ResponseBean<List<User>>> login(@FieldMap Map<String, String> params);
//        Observable<NetResponse<User>> login(@Field("mobile")String mobile,@Field("password")String password);
//        Observable<UserAuto> login(@FieldMap Map<String, String> params);
//Single 和Observable，Flowable一样会发送数据，不同的是订阅后只能接受到一次:
//        在RxJava2里，引入了Flowable这个类：Observable不包含backpressure处理，而Flowable包含。
        @FormUrlEncoded
        @POST("mycustomers")
        Observable<ResponseBean<List<Customer>>> getCustomers(@FieldMap Map<String, String> params);


        @FormUrlEncoded
        @POST("allemployee")
        Observable<ResponseBean<List<Employee>>> getEmployees(@FieldMap Map<String, String> params);

        @FormUrlEncoded
        @POST("mybills")
        Observable<ResponseBean<List<Bill>>> getBills(@FieldMap Map<String, String> params);

        @FormUrlEncoded
        @POST("myproducts")
        Observable<ResponseBean<List<Product>>> getProductss(@FieldMap Map<String, String> params);

        @FormUrlEncoded
        @POST("getmsglist")
        Observable<ResponseBean<List<MsgList>>> getMsgs(@FieldMap Map<String, String> params);

        @FormUrlEncoded
        @POST("mytemplates")
        Observable<ResponseBean<List<Bill>>> getTemplates(@FieldMap Map<String, String> params);
    }
}
